package com.cn.springcloudwechat.mapper.mapper.find.courseall;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

import com.cn.springcloudwechat.common.mybatis.Page;
import com.cn.springcloudwechat.model.YmCoursePackage;
import org.springframework.stereotype.Repository;

@Repository
public interface YmCoursePackageMapper {
    int deleteByPrimaryKey(Long coursePackageId);

    int insert(YmCoursePackage record);

    Long insertSelective(YmCoursePackage record);

    List<YmCoursePackage> selectByPrimaryKey(@Param("YmCoursePackage")YmCoursePackage ymcoursePackage,Page<Object> page);
    
    /**
	 * 课程包的查询(明细)
	 * 
	 * @param Long coursePackageId
	 *           
	 * @return List<YmCoursePackage>
	 */
    List<YmCoursePackage> queryCoursePackageDetailMapper(Long coursePackageId);
    
    void updateCoursePackageStateMapper(Map<String,Object> map);
    
    Integer IsBuy(Map<String,Object> map);
    
    /**
	 * 课程包的收藏
	 * 
	 * @param Long coursePackageId
	 *           
	 * @return SUCC
	 */
    void updateCollectionNumberMapper(Long coursePackageId);
    

    int updateByPrimaryKeySelective(YmCoursePackage record);

    int updateByPrimaryKeyWithBLOBs(YmCoursePackage record);

    int updateByPrimaryKey(YmCoursePackage record);



    YmCoursePackage  getCoursePageDataByCoursePageId(Long coursePackageId);


    /**
     * 根据订单id查询课程包
     * @param orderId
     * @return
     */
    YmCoursePackage getYmCoursePackageByOrderId(Long orderId);

    /**
     * 修改购买数
     * @param coursePackageId
     * @param saleTotal
     * @return
     */
    Integer updateSaleTotal(@Param("coursePackageId") Long coursePackageId,@Param("saleTotal") Long saleTotal);
}